﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.ComponentModel;
using System.Windows.Media.Imaging;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using ThreeByte.ActiveDeck.Content;
using log4net;

namespace ThreeByte.ActiveDeck.Config
{
    public class CurrentSlideConfig : PageConfig
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(CurrentSlideConfig));

        #region Public Properties

        private BitmapImage _previewImage;
        public BitmapImage Image {
            get {
                return _previewImage;
            }
            set {
                _previewImage = value;
                NotifyPropertyChanged("Image");
            }
        }

       
        #endregion Public Properties

        public CurrentSlideConfig() {
        }

        public CurrentSlideConfig(XElement node, Dictionary<Guid, GraphicResource> resources)
            : base(node, resources) {
        }

        public override void Refresh() {
            base.Refresh();
            try {
                //PowerPoint.Presentation currentPresentation = Parent.Presentation;
                //Image = SlideUtil.Snapshot(currentPresentation.Slides.FindBySlideID(SlideId));
            } catch(Exception ex) {
                log.Warn("Cannot Refresh the Current Slide", ex);
                //This should only happen the first time
            }
        }

    }
}
